<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Service/weibaoindex')}">维保管理</a></li>
    </ul>
    <div>
        <form class="well form-inline margin-top-20" action="{:url('Service/weibaoindex')}" method="get">
            <label>名称:
                <input type="text" class="form-control" name="service_name" placeholder="请业务编号、经办人名称"
                       value="{:input('request.service_name')}">
                服务状态：
                <select name="service_status" class="form-control">
                    <option value="0" >——请选择——</option>
                    <option value='1'<if condition="'1' eq $service_status">selected</if>>未确认</option>
                    <option value="2" <if condition="'2' eq $service_status">selected</if>>已确认</option>
                    <option value="3" <if condition="'3' eq $service_status">selected</if>>已完成</option>
                    <option value="4" <if condition="'4' eq $service_status">selected</if>>已上传</option>
                </select>
                登记时间: <input type="text" class='js-date form-control' name="start_time" autocomplete="off"
                             value="{:input('request.start_time/s','')}" placeholder="请输入开始时间">
                ~
                <input type="text" class='js-date form-control' name="end_time" value="{:input('request.end_time/s','')}" autocomplete="off"
                       placeholder="请输入结束时间">
                交付时间: <input type="text" class='js-date form-control' name="start_time1" autocomplete="off"
                             value="{:input('request.start_time1/s','')}" placeholder="请输入开始时间">
                ~
                <input type="text" class='js-date form-control' name="end_time1" value="{:input('request.end_time1/s','')}" autocomplete="off"
                       placeholder="请输入结束时间">
            </label>
            <input type="submit" class="btn btn-primary" value="搜索"/>
            <a class="btn btn-danger" href="{:url('Service/weibaoindex')}">清空</a>
        </form>
    </div>
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <th align="left" width="3%">序号</th>
            <th align="left" width="9%">登记时间</th>
            <th align="left" width="9%">交付时间</th>
            <th align="left" width="10%">业务编号</th>
            <th align="left" width="8%">业务类型</th>
            <th align="left" width="15%">业务内容</th>
            <th align="left" width="10%">墓位编号</th>
            <th align="left" width="15%">具体位置</th>
            <th align="left" width="5%">经办人</th>
            <th align="left" width="5%">状态</th>
            <th width="15%">{:lang('ACTIONS')}</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="results" item="vo">
            <tr>
                <td>{$vo.id}</td>
                <td><php>echo date('Y-m-d H:i', $vo['register_time'])</php></td>
                <td><php>echo date('Y-m-d H:i', $vo['deliver_time'])</php></td>
                <td>{$vo.business_num}</td>
                <td>{$vo.business_type}</td>
                <td>{$vo.business_content}</td>
                <td>{$vo.tomb_num}</td>
                <td>{$vo.tomb_address}</td>
                <td>{$vo.handle_name}</td>
                <td>
                    <if ($vo.service_status)==1><label style="color:#FF0000">未确认</label>
                        <elseif ($vo.service_status)==2/>
                            <label style="color:#87CEFA">已确认</label>
                            <elseif ($vo.service_status)==3/>
                                <label style="color:#43CD80">已完成</label>
                                <elseif ($vo.service_status)==4/>
                                    <label style="color:#Khaki2">已上传</label>
                    </if>
                </td>

                <td>
                    <if ($vo.service_status)==3 || ($vo.service_status)==4>
                        <a href="javascript:;" class="print_cert_bd " data-id="{$vo['id']}" data-href="{:url('Print/print_cert')}?mark=2&type=w&id={$vo['id']}">补打</a>
                        |
                        <a href="{:url('Service/weibaofinish',array('id'=>$vo['id'],'TaskType'=>'weibao'))}">查看任务反馈</a>
                    </if>
                    <if ($vo.service_status)==1 || ($vo.service_status)==2>
                        <a href="javascript:;" class="print_cert" data-id="{$vo['id']}" data-href="{:url('Stamp/print_cert',array('id'=>$vo['id'],'type'=>4))}">任务确认</a>
                        <!--                    <a href="{:url('Service/weibao_edit',array('id'=>$vo['id']))}">任务确认</a>-->
                        |
                        <a href="{:url('Service/weibaofinish',array('id'=>$vo['id'],'TaskType'=>'weibao'))}">任务反馈</a>
                    </if>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="pagination" style="margin-top: -10px">{$page}</div>
    <div id="print_html" style="display: none"></div>
    <script type="text/javascript" src="__STATIC__/js/lodop/LodopFuncs.js?v={:time()}"></script>
</div><script type="text/javascript" src="__STATIC__/js/admin.js?v={:time()}"></script>
<script >
    $('.print_cert_bd').click(function () {
        var  href = $(this).data('href');
        $.ajax({
            type: "get", url: href,
            success: function (strHtml) {
                console.log('打印')
                var data = strHtml.data;
                console.log(data)
                $('#print_html').html(data.html)
                service_preview('济南恭德陵园维保服务单',4,data.year,data.no)
            }
        })
    })
    $('.print_cert').click(function () {
        var  href = $(this).data('href');
        var  id = $(this).data('id');
        layer.confirm("任务确认吗？", {
            icon: 3,
            title: "提示", btn: ['确定', '暂不']
            , btn1: function () {
                $.ajax({
                    type: "POST",
                    url: "{:url('task_confirmation')}",
                    data: {
                        t: 'w',
                        id: id
                    },
                    dataType: "json",
                    success: function (r) {
                        $.ajax({
                            type: "get", url: r.danju_url,
                            success: function (strHtml) {
                                console.log('打印')
                                var data = strHtml.data;
                                console.log(data)
                                $('#print_html').html(data.html)
                                service_preview('济南恭德陵园维保服务单',4,data.year,data.no)
                                // location.reload();
                            }
                        })
                    }
                })
            }
        })
    })
</script>
<script language="javascript" type="text/javascript">
    var LODOP; //声明为全局变量
</script>
<script type="text/javascript" src="__STATIC__/js/print.js?v={:time()}"></script>
</body>
</html>